package com.bw.jetpacktest

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Button
import com.bw.jetpacktest.databinding.DataBindingActivity
import com.bw.jetpacktest.life.LifeActivity
import com.bw.jetpacktest.live.LiveActivity
import com.bw.jetpacktest.room.RoomActivity

class MainActivity : AppCompatActivity(),View.OnClickListener {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        findViewById<Button>(R.id.life_btn).setOnClickListener(this)
        findViewById<Button>(R.id.live_btn).setOnClickListener(this)
        findViewById<Button>(R.id.binding_btn).setOnClickListener(this)
        findViewById<Button>(R.id.room_btn).setOnClickListener(this)
    }
    override fun onClick(p0: View?) {
        var id = p0!!.id
        when(id){
            R.id.life_btn->{
                startActivity(Intent(this,LifeActivity::class.java))
            }
            R.id.live_btn->{
                startActivity(Intent(this,LiveActivity::class.java))
            }
            R.id.binding_btn->{
                startActivity(Intent(this,DataBindingActivity::class.java))
            }
            R.id.room_btn->{
                startActivity(Intent(this,RoomActivity::class.java))
            }
        }

    }
}